package com.heima.pri02;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

public class ZiFuHuanChongLiu02 {
    //2.字符缓冲输入流BufferedRead:readLine 读一整行
    public static void main(String[] args) throws IOException {
        BufferedReader bu = new BufferedReader(new FileReader("day11\\a.txt"));
    //读不到数据会返回NULL
//        String line = bu.readLine();
//        String line2 = bu.readLine();
//        String line3 = bu.readLine();
//        String line4 = bu.readLine();
//        System.out.println(line);
//        System.out.println(line2);
//        System.out.println(line3);
//        System.out.println(line4);
//        bu.close();
        //使用循环
        //readLine()可以读取一整行，但是不会打印回车换行符
        String line;
       while ((line=bu.readLine())!=null){
           System.out.println(line);
       }
       bu.close();
    }
}
